package com.tanhua.common.enums;

public enum LogTypeEnum {
    /**
     * 操作类型,
     * 01为登录，0201为发动态，0202为浏览动态，0203为动态点赞，0204为动态喜欢，0205为评论，0206为动态取消点赞，0207为动态取消喜欢，0301为发小视频，0302为小视频点赞，0303为小视频取消点赞，0304为小视频评论
     */
    LOGIN("1", "登录"),
    MOVEMENTS_ADD("201", "发动态"),
    MOVEMENTS_READ("202", "浏览动态"),
    MOVEMENTS_LIKE("203", "动态点赞"),
    MOVEMENTS_LOVE("204", "动态喜欢"),
    MOVEMENTS_COMMENT("205", "动态评论"),
    MOVEMENTS_UNLIKE("206", "动态取消点赞"),
    MOVEMENTS_UNLOVE("207", "动态取消喜欢"),
    VIDEO_ADD("301", "发小视频"),
    VIDEO_LIKE("302", "小视频点赞"),
    VIDEO_UNLIKE("303", "小视频取消点赞"),
    VIDEO_COMMENT("304", "小视频评论"),;

    private String value;
    private String name;

    LogTypeEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    /**
     * 根据类型返回枚举
     *
     * @param type
     * @return
     */
    public static String getOperation(int type) {
        String operation = "未知操作";
        switch (type) {
            case 0: {
                operation = LogTypeEnum.LOGIN.value;
                break;
            }
            case 1: {
                operation = LogTypeEnum.MOVEMENTS_ADD.value;
                break;
            }
            case 2: {
                operation = LogTypeEnum.MOVEMENTS_READ.value;
                break;
            }
            case 3: {
                operation = LogTypeEnum.MOVEMENTS_LIKE.value;
                break;
            }
            case 4: {
                operation = LogTypeEnum.MOVEMENTS_LOVE.value;
                break;
            }
            case 5: {
                operation = LogTypeEnum.MOVEMENTS_COMMENT.value;
                break;
            }
            case 6: {
                operation = LogTypeEnum.MOVEMENTS_UNLIKE.value;
                break;
            }
            case 7: {
                operation = LogTypeEnum.MOVEMENTS_UNLOVE.value;
                break;
            }
            case 11: {
                operation = LogTypeEnum.VIDEO_ADD.value;
                break;
            }
            case 12: {
                operation = LogTypeEnum.VIDEO_LIKE.value;
                break;
            }
            case 13: {
                operation = LogTypeEnum.VIDEO_UNLIKE.value;
                break;
            }
            case 14: {
                operation = LogTypeEnum.VIDEO_COMMENT.value;
                break;
            }

        }
        return operation;
    }
}
